﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<KLS.PPDS.Web.Models.CompanyViewModel>" %>
<%@ Import Namespace="KLS.PPDS.Resources" %>
<%@ Import Namespace="KLS.PPDS.Utility.Html" %>
<%@ Import Namespace="KLS.PPDS.Utility" %>


    
    <%using (Html.BeginForm("SaveCompanySettings", "Company", FormMethod.Post, new { @class = "submitform", @id = "saveCompanySettingsForm", @onkeypress = "applyEnter(event);" }))
      {%>
    <%-- <input type="hidden" id="companyId" name="companyId" value="<%=Model.CompanyToEdit==null?"":Model.CompanyToEdit.Id.ToString() %>" />--%>
    <input type ="hidden" id = "companyNameInDb" value = "<%=Model.Company.CompanyName%>"/>
    <fieldset>
    <legend><%:CommonString.CompanySettings%></legend>
    
    <%:Html.HiddenFor(c => c.Company.Id)%>
    <table>
        <tr>
            <td>
                <%:CommonString.Id + ":"%>
            </td>
            <td>
                <input disabled="disabled" type="text" value="<%=Model.Company.Id==0?"":Model.Company.Id.ToString() %>" />
            </td>
        </tr>
        <tr>
            <td>
                <%:CommonString.Name + ":"%>
            </td>
            <td>
                <%:Html.TextBoxFor(c => c.Company.CompanyName, new { @class = "required", @maxLength = "100" })%>
            </td>
        </tr>
        <% if (Model.Company.Id > 0) 
           {%>                      
            <tr>
                <td>
                     <%:CommonString.Editor + ":"%>
                
                </td>
                <td>
                    <%=Html.DropDownListFor(c => c.Company.Editor, Model.Editors, CommonMessage.SelectEditor, new { })%>
                </td>
            </tr>
        <%    
           }%>
        <tr>
            <td>
                <%:CommonString.Graphic + ":"%>
            </td>
            <td>
                <%=Html.DropDownListFor(c => c.Company.Graphic, Model.Graphics, CommonMessage.SelectGraphics, new {  })%>
            </td>
        </tr>
        
    </table>
    <table class="buttons-area">
        <tr>
            <td>
              <%if (Model.Company.Id > 0 && CommonSession.CompanyId != Model.Company.Id)
              {%>
               
                    <%--<%:Html.DivActionLink(CommonString.Delete, "", new { @class = "delete-button", @onclick = string.Format("AjaxDeleteCallWithFilter('company/DeleteCompany?companyId={0}')", Model.Company.Id) })%>--%>
                    <%:Html.DivActionLink(CommonString.Delete, "", new { @class = "delete-button", @href = string.Format("company/DeleteCompany?companyId={0}", Model.Company.Id), @message = CommonMessage.DeleteCompanyConfirmation })%>
                
            <%} %>
               
                    <%:Html.DivActionLink(CommonString.Save, "", new { @class = "CompanySaveButton AjaxSubmitEast save-button",@message = CommonMessage.CompanyRenameWarning })%>
                           
            </td>
        </tr>
    </table>
</fieldset>
    <%}%>

